Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix B - Scriptable Text Editor Dictionary / Scriptable Text Editor Object Class Definitions


Text

An object of class Text is a series of one or more contiguous characters.

PROPERTIES
Font
The name of the font of the text object. If the font varies
within the object, the Font property specifies the font of the
first character.
Class: String
Modifiable? Yes
Length
The number of characters in a text object.
Class: Integer
Modifiable? No
Offset
The offset, in characters, from the beginning of the document to the first character of a text object.
Class: Integer
Modifiable? No
Size
The size, in points, of the text object. If the size varies within the object, the Size property specifies the size of the first character.
Class: Integer
Modifiable? Yes
Style
The text styles of a text object. If the text styles vary within the object, the Style property specifies the styles of the first character.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. The On Styles property specifies the styles that apply to the text object. The Off Styles property specifies the styles that do not apply to the text object. Both properties are lists of constants that specify text styles. See "Elements of Text Objects" on page 314 for information
about how styles are used. The constants that can be used in Style property lists are bold, italic, outline, underline, and shadow.
Modifiable? Yes
Uniform Styles
The text styles that are uniformly "on" or "off" for all characters of a text object.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. The On Styles property specifies the styles that apply to all the characters of the text object. The Off Styles property specifies the styles that do not apply to any of the characters of the text object. Both properties are lists of constants that specify text styles. If a style does not appear in either list, the style applies to some but not all of the characters in the object. See "Elements of Text Objects" on page 314 for information about how styles are used. The constants that can be used in Uniform Styles property lists are bold, italic, outline, underline, and shadow.
Modifiable? No
ELEMENT CLASSES
See "Elements of Text Objects" on page 314 for a general discussion of these element classes.

Character
Characters contained in the text
Paragraph
Paragraphs contained in the text
Text
Series of characters contained in the text
Text Item
Text items contained in the text
Word
Words contained in the text
COMMANDS HANDLED
Copy, Count, Cut, Data Size, Delete, Duplicate, Exists, Get, Make, Move,
Select, Set

DEFAULT VALUE CLASS RETURNED
Styled Text

EXAMPLE
tell document "Memo" of app "Scriptable Text Editor"   move (the text from paragraph 10 to paragraph 12) to end
end tell
NOTES
The Scriptable Text Editor does not allow you to refer to an object of class Text with the Index reference form (such as text 5 of characters 1 thru 1024) because it does not make sense to number the many possible objects of class Text in a text object.

Text is a plural class name. You cannot use it in places where AppleScript expects a singular class name. For example, the following statement results
in a compilation error.

tell document "Intro" of app "Scriptable Text Editor"   get every text from paragraph 1 to paragraph 2
end tell
--causes an error because text is a plural class name 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996